<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="UTF-8">
        <title>考试登录系统</title>
        <link rel="stylesheet" href="../CSS/登录页面CSS.css">
</head>
<body background="../Image/山谷星空.jpg">
<div class="father">
        <span class="title"><header><h1>登录系统</h1></header></span>
        <!--左边的广告栏-->
        <div class="tt">
                <img src="../Image/考试.jpg" alt="考试">
        </div>
        <div class="deng">
                <h1 style="color: black">登录</h1>
                <form  id="test_from"method="get" >
                        <p>姓名： <input class="in" type="text" name="account" placeholder="请输入姓名" required></p>
                        <p>密码： <input class="in" type="password" name="password" placeholder="请输入密码" required></p>
                        <p><select name="myType" id="">
                                <option value="student">学生</option>
                                <option value="teacher">老师</option>
                        </select>
                        </p>
                        <p><input style="width: 100px" class="in" id="sub" type="submit" onclick="login()"></p>
                </form>
        </div>
</div>
</body>
<script>
    function login() {
        var form = document.getElementById('test_from');
        console.log(form[2].value);
        debugger;
        if(form[2].value === "student"){
        window.location.href="考试系统1.html";
        }else if (form[2].value ==="teacher"){
        window.location.href="教学系统.html";
        }
    }
</script>
</html>